package com.web;

import com.pojo.Fm_x;
import com.service.FmService_x;
import com.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("fm")
public class FmController_x {
    @Autowired
    private FmService_x fmServiceX;
    @RequestMapping("select")
    public List<Fm_x> selectAll() {
        return fmServiceX.selectAll();
    }

    @RequestMapping("add")
    public Result add(Fm_x fmX){
        return Result.ok(fmServiceX.add(fmX));
    }
    @RequestMapping("update")
    Result update(Fm_x fmX){
        return Result.ok(fmServiceX.update(fmX));
    }
    @RequestMapping("delete")
    Result delete(Integer id){
        return Result.ok(fmServiceX.delete(id));
    }
    @RequestMapping("/selectAll")
    public List<Fm_x> select(Integer id, String title) {
        return fmServiceX.select(id,title);
    }
}
